package com.chineseall.app.pojo.mongo;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

public class MMessage extends BasicDBObject {
    //类型
    private String mtype = "mtype";
    //头像
    private String icon = "icon";
    //连接地址
    private String url = "url";
    //标题
    private String title = "title";
    //内容
    private String body = "body";
    // 概要
    private String summary = "summary";
    // clientId
    private String clientId = "clientId";

    public MMessage mtype(int val) {
        this.put(mtype, val);
        return this;
    }

    public int mtype() {
        return this.getInt(mtype, 0);
    }

    public MMessage icon(String val) {
        this.put(icon, val);
        return this;
    }

    public String clientId() {
        return this.getString(clientId);
    }

    public MMessage clientId(String val) {
        this.put(clientId, val);
        return this;
    }

    public String icon() {
        return this.getString(icon);
    }

    public MMessage url(String val) {
        this.put(url, val);
        return this;
    }

    public String url() {
        return this.getString(url);
    }

    public MMessage title(String val) {
        this.put(title, val);
        return this;
    }

    public String title() {
        return this.getString(title);
    }

    public MMessage body(String val) {
        this.put(body, val);
        return this;
    }

    public String body() {
        return this.getString(body);
    }

    public MMessage summary(String val) {
        this.put(summary, val);
        return this;
    }

    public String summary() {
        return this.getString(summary);
    }

    public MMessage param(DBObject jo) {
        this.put("param", jo);
        return this;
    }

    public MMessage code(int code) {
        this.put("code", code);
        return this;
    }

}
